package com.wtb.javatool.dao;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.wtb.javatool.entity.Assets;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

@Mapper
public interface AssetsMapper extends BaseMapper<Assets> {

    // 根据帮区ID查询所有资源Id
    List<Long> getAssetsIdByBandId(@Param("bandId") Long bandId);

    // 根据帮区ID查询所有资源
    List<Assets> getAssetsByBandId(@Param("bandId") Long bandId);

    // 根据目录ID查询所有资源
    List<Assets> getAssetsByCatalogId(@Param("catalogId") Long catalogId);

    // 根据ID查询Assets
    Assets getById(@Param("id") Long id);

    // 根据文档ID查询Assets
    List<Assets> getByDocumentId(@Param("documentId") Long documentId);

    // 根据文档ID查询Assets
    Assets getByDocumentIdAndCatalogId(@Param("documentId") Long documentId, @Param("catalogId") Long catalogId);

    // 插入Assets
    int insert(Assets assets);

    // 更新Assets
    int update(Assets assets);

    // 根据Id删除Assets
    int delete(@Param("id") Long id);

    // 批量根据Id删除Assets
    int deleteMany(@Param("ids") List<Long> ids);

    // 根据文档Id删除Assets
    int deleteByDocumentId(@Param("documentId") Long documentId);

    // 根据目录Id删除Assets
    int deleteByCatalogId(@Param("catalogId") Long catalogId);

    // 批量根据目录Id删除Assets
    int deleteManyByCatalogId(@Param("catalogIds") List<Long> catalogIds);
}